<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">

    <ui:define name="content"> 
        <h:form id="formMain">
            <h1>TCube View All Transactions</h1>         

            <p:panel header="TCube View All Transactions">
                <p:accordionPanel autoHeight="false">
                    <p:tab title="Transactions">
                        <p:dataTable var="transaction" value="#{transactionManagerBean.transactionsList}" paginator="true" 
                                     rows="10" emptyMessage="No Transaction" dblClickSelect="true">

                            <p:column sortBy="#{transaction.id}" filterBy="#{transaction.id}">
                                <f:facet name="header">
                                    <h:outputText value="ID" />
                                </f:facet>
                                <h:outputText value="#{transaction.id}" />
                            </p:column>
                            <p:column sortBy="#{transaction.datePaid}" filterBy="#{transaction.datePaid}">
                                <f:facet name="header">
                                    <h:outputText value="Date Paid" />
                                </f:facet>
                                <h:outputText value="#{transaction.datePaid}" />
                            </p:column>
                            <p:column sortBy="#{transaction.description}" filterBy="#{transaction.description}">
                                <f:facet name="header">
                                    <h:outputText value="Description" />
                                </f:facet>
                                <h:outputText value="#{transaction.description}" />
                            </p:column>
                            <p:column sortBy="#{transaction.paymentManagement.id}" filterBy="#{transaction.paymentManagement.id}">
                                <f:facet name="header">
                                    <h:outputText value="Billing ID" />
                                </f:facet>
                                <h:outputText value="#{transaction.paymentManagement.id}" />
                            </p:column>
                            <p:column sortBy="#{transaction.amount}" filterBy="#{transaction.amount}">
                                <f:facet name="header">
                                    <h:outputText value="Amount" />
                                </f:facet>
                                <h:outputText value="#{transaction.amount}" />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:accordionPanel> 
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>